﻿module BoardTool.Main

open System

open BoardTool.Tool
open BoardTool.List
open BoardTool.FixIt
open BoardTool.KillFluff
open BoardTool.Sort
open BoardTool.InspectTerrains
open BoardTool.KillSpecials
open BoardTool.Transmute
open BoardTool.RemoveDupFiles

let initTool() =
    let tool = Tool()
    tool.add <| HelpCommandFactory( tool )
    tool.add <| LIST_COMMAND_FACTORY
    tool.add <| FIX_DIR_COMMAND_FACTORY
    tool.add <| KILL_FLUFF_COMMAND_FACTORY
    tool.add <| SORT_COMMAND_FACTORY
    tool.add <| INSPECT_TERRAINS_COMMAND_FACTORY
    tool.add <| KILL_SPECIALS_COMMAND_FACTORY
    tool.add <| TRANSMUTE_COMMAND_FACTORY
    tool.add <| REMOVE_DUP_FILES_COMMAND_FACTORY
    tool

[<EntryPoint>]
let main args =
    let tool = initTool()
    if args.Length > 0 then tool.run( args ) else tool.printBriefHelp Console.Out
    0